package com.ysd.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ysd.entity.Address;
import com.ysd.service.AddressService;
@Controller
public class AddressContorller {
	@Autowired
	private AddressService addressService;
	@RequestMapping("getAddress")
	@ResponseBody
	public Object getAddress(Address address) {
		Address a= new Address();
		a.setUserId(1);
		List<Address> list=addressService.findAllAddress(a);
		return list;
		
	}
	@RequestMapping("delectAddress")
	@ResponseBody
	public Object delectAddress(Integer id) {
		int n=addressService.delectAddress(id);
		return n;
	}
	@RequestMapping("addAddress")
	@ResponseBody
	public Object addAddress(Address address) {
		int a=addressService.addAddress(address);
		return a;
	}  
	
}
